using System.ComponentModel.DataAnnotations;

namespace AdminSystem.API.Models
{
    public class Module
    {
        [Key]
        public int Id { get; set; }

        [Required]
        [StringLength(50)]
        public string Name { get; set; } = string.Empty;

        [StringLength(200)]
        public string? Description { get; set; }

        [StringLength(100)]
        public string? Icon { get; set; }

        [StringLength(200)]
        public string? Route { get; set; }

        public int? ParentId { get; set; }

        public int SortOrder { get; set; } = 0;

        public bool IsActive { get; set; } = true;

        public DateTime CreatedAt { get; set; } = DateTime.UtcNow;

        public DateTime? UpdatedAt { get; set; }

        // Navigation properties
        public virtual Module? Parent { get; set; }
        public virtual ICollection<Module> Children { get; set; } = new List<Module>();
    }
}
